package com.lanp.gencode.test;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @author JiangPeng
 * Created with IntelliJ IDEA.
 * Description:  json比较
 * Date: 2023-08-29 10:01:34
 */
public class JsonCompare {
    static String a = "{\"settle_object_name\":\"飞鸟眼镜店\",\"remark\":\"测试结算协议\",\"settle_delay\":3,\"deposit_ratio\":\"1\",\"deposit_up\":5000,\"begin_time\":1758729600000,\"end_time\":1759247999999,\"app\":\"YJQ\",\"agrt_type\":\"seller_trade\",\"settle_object\":\"seller_company\",\"settle_object_id\":\"628125008737536\",\"enterprise_id\":\"628127768589581\",\"enterprise_name\":\"深圳市友悦机器人科技有限有限公司\",\"agrt_level\":0,\"fixed_platform_fee\":0,\"ratio_platform_fee\":0,\"settle_interval_unit\":\"d\",\"settle_interval_time\":1,\"operator\":\"余奕\",\"agrt_id\":0,\"ext_rules\":[{\"codes\":[\"278283715393235\"],\"settle_scope\":\"CATEGORY\",\"ratio_platform_fee\":5,\"fixed_platform_fee\":0}]}";
    static String b = "{\"agrt_code\":\"1173182354863721\",\"agrt_id\":1173182354863720,\"agrt_level\":0,\"agrt_type\":\"seller_trade\",\"app\":\"YJQ\",\"auto_renewal\":\"MANUAL\",\"begin_time\":1758729600000,\"category_list\":[{\"ext_code\":\"278283715393235\",\"ext_name\":\"工业原料\",\"fixed_platform_fee\":0,\"is_postage_include\":false,\"platform_fee_down\":null,\"platform_fee_up\":null,\"ratio_platform_fee\":5}],\"company_id\":628127768589581,\"create_time\":1693214749000,\"create_user\":\"余奕\",\"deposit_ratio\":1,\"deposit_up\":5000,\"end_time\":1759247999000,\"enterprise_id\":628127768589581,\"enterprise_name\":\"深圳市友悦机器人科技有限有限公司\",\"file_name\":null,\"file_url\":null,\"fixed_platform_fee\":0,\"has_rebate\":false,\"initial_amount\":null,\"invoice_support\":\"SUPPORT\",\"is_postage_include\":false,\"is_private\":false,\"is_renewal_agrt\":false,\"ladder_scope_dto_list\":null,\"ladder_term_dto_list\":null,\"last_time\":1693214749000,\"modify_user\":\"余奕\",\"now_agrt_code\":\"725119739760129\",\"now_begin_time\":1625414400000,\"now_end_time\":1745855999000,\"platform_fee_down\":null,\"platform_fee_up\":null,\"product_list\":[],\"rate_type\":\"fixed\",\"ratio_platform_fee\":0,\"rebate_list\":null,\"remark\":\"测试结算协议\",\"reply_status\":\"PENDING\",\"reply_time\":null,\"reserved_amount\":null,\"settle_account_id\":626652665245867,\"settle_delay\":3,\"settle_interval_time\":1,\"settle_interval_unit\":\"d\",\"settle_object\":\"seller_company\",\"settle_object_id\":628125008737536,\"settle_object_name\":\"飞鸟眼镜店\",\"shop_id\":628125008737536,\"shop_name\":\"飞鸟眼镜店\",\"sku_list\":[],\"status\":\"PENDING\",\"term_relation\":\"or\",\"user_id\":null}";


    public static void main(String[] args) {
        JSONObject ao = JSON.parseObject(a);
        JSONObject bo = JSON.parseObject(b);
        for (String key : ao.keySet()) {
            if (!bo.containsKey(key)) {
                System.out.println(key + "-不存在b中");
            }
        }
    }
}
